package com.mbc.hr.manager;

import javax.persistence.EntityManager;

import com.mbc.hr.entities.FingerPrintID;

public class FingerPrintIDMgr{
	public static long getFingerPrintID(EntityManager em)throws Exception{
		try {
			em.createQuery("update FingerPrintID set id = id + 1").executeUpdate();
			return em.createQuery("select fp from FingerPrintID fp", FingerPrintID.class).setFirstResult(0).setMaxResults(1).getSingleResult().getId();
		} catch (Exception e) {
			throw e;
		}
	}
}
